import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login.vue'
import Doctor from '../views/doctorSystem.vue'
// 1.引入组件login和doctor

Vue.use(VueRouter)

const routes = [{
        path: "/",
        redirect: "/login"
    },
    {
        path: '/login',
        name: 'login',
        component: Login
    },
    {
        path: '/doctor',
        name: 'doctor',
        component: Doctor
    }
    // 2.在路由规则中定义路径和对应的组件，并把首页重定向到登录页面
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router